import request  from '@/utils/request';

import { BASE_URL } from '@/config/query';

export async function queryPage(params = { pageSize: 10, pageNum: 1 }) {
  return request(`${BASE_URL}/report_template/page`, params)
}

export async function queryList(params = { pageSize: 10, pageNum: 1 }) {
  return request(`${BASE_URL}/report_template/list`, params)
}

export async function queryInfoById(id) {
  return request(`${BASE_URL}/report_template/detail/${id}`)
}

export async function create(params) {
  return request(`${BASE_URL}/report_template/create`, params)
}

export async function update(params) {
  return request(`${BASE_URL}/report_template/modify`, params)
}

// 报表模版批量删除
export async function templateRemove(params) {
  return request(`${BASE_URL}/report_template/remove`, params)
}

// 报表模版启用/停用
export async function templateStartOrEnd(id) {
  return request(`${BASE_URL}/report_template/start_stop`, {id})
}

export async function queryProblemPage(params) {
  return request(`${BASE_URL}/report_template_question/page`, params)
}

export async function queryProblemList(params) {
  return request(`${BASE_URL}/report_template_question/qr_code/list`, params)
}
